function getCharCode(){
    let str = prompt("请输入字符：",'').replace(/\s/g, "") // 弹框,并去除所有空格
    let arr = []
    for(let i = 0; i< str.length;i++) {
        arr.push(str.charCodeAt(i))
    }
    let result = arr.reduce((temp,curent) => {
        temp +=curent + " "
        return temp
    },"")
    alert('结果是：'+result)
    return ""
}
getCharCode()

